package com.hyf.service.impl;

import com.hyf.dao.AccountDao;
import com.hyf.service.AccountService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service("accountService")
@Transactional
public class AccountServiceImpl implements AccountService {
    private AccountDao accountDao;
    public void setAccountDao(AccountDao accountDao) {
        this.accountDao = accountDao;
    }
    @Transactional(isolation = Isolation.DEFAULT,propagation = Propagation.REQUIRED,timeout = -1,readOnly = false)
    public  void zz(String out, String in, double money){
        accountDao.updateSubMoneyByName(out,money);
       System.out.println(1/0);
        accountDao.updateAddMoneyByName(in,money);
    }
}
